package com.sevenStar.healthManagement.mapper;

import com.sevenStar.healthManagement.entity.Admin;
import com.sevenStar.healthManagement.entity.User;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface AdminMapper {
	@Select("SELECT * FROM admin WHERE username = #{username} AND password = #{password}")
	Admin selectOne(Admin admin);

	@Select("select * from user where id = #{id}")
	@Results({
			@Result(column = "id_number", property = "idNumber")
	})
	User selectById(String id);
	@Update("update user set name = #{name},gender =#{gender},phone = #{phone},id_number =#{idNumber},password =#{password} where id =#{id}")
	int updateUserById(User user);
}
